<template>
  <el-tooltip>
    <div slot="content">
      <div class="tip">
        <span class="tip-title">秤编号:&nbsp;</span>
        <span class="tip-content">{{ item.ecrID }}</span>
      </div>
      <div class="tip">
        <span class="tip-title">摊位号:&nbsp;</span>
        <span class="tip-content">{{ item.busiNo }}</span>
      </div>
      <div class="tip">
        <span class="tip-title">秤状态:&nbsp;</span>
        <span class="tip-content">{{ item.status===0||item.status===2?'在线':'异常' }}</span>
      </div>
      <div class="tip">
        <span class="tip-title">经营户:&nbsp;</span>
        <span class="tip-content">{{ item.busiInfo.busiName }}</span>
      </div>
      <div class="tip">
        <span class="tip-title">总交易:&nbsp;</span>
        <span>
          <span class="tip-content">{{ item.tradesNum }}</span>&nbsp;笔（共
          <span class="tip-content">{{ item.totalPrice }}</span>&nbsp;元）
        </span>
      </div>
    </div>
    <img :src="imgArr[item.status]" alt class="img-balance">
  </el-tooltip>
</template>

<script>
export default {

  props: {
    item: {
      type: Object,
      default(){}
    }
  },
  data() {
    return {
      // 计数器
      count: 0,
      //
      // status: state,
      imgArr: [
        require('@/assets/imageSet/balance_green.png'),
        require('@/assets/imageSet/balance_red.png'),
        require('@/assets/imageSet/balance_online_flash.gif'),
        require('@/assets/imageSet/balance_offline_flash.gif')
      ]
    }
  }
  // watch: {
  //   count: function(val) {
  //     if (val === 0 && this.status > 1) {
  //       setTimeout(() => {
  //         this.status = this.state - 2;
  //       }, flashTime);
  //       val = 1;
  //     }
  //   }
  // }
}
</script>
<style lang="scss">
.img-balance {
  width: 30px;
  height: 30px;
  cursor: pointer;
}
.el-tooltip__popper,
.el-tooltip__popper.is-dark {
  background: rgba(0, 0, 0, 0.7) !important;
  //   min-width: 18em;
  //   min-height: 10em;
}
.tip {
  line-height: 25px;
  font-family: "黑体";
  font-size: 16px;
}
.tip-content {
  color: #4fd222;
}
</style>
